<?php
session_start();
include_once 'php/connection.php';

if(!isset($_SESSION['nenunnanu_admin']))
{
header("location:admin_login.php");
}
if(isset($_GET['type']) && $_GET['type']=='article' && isset($_GET['id']))
{
  $sql="delete from articles where id='$_GET[id]'";
  if(!mysql_query($sql))
  {
  echo mysql_error();
  }
  else
  {
   header("location:manage.php?type=articles");
  }
}
else if(isset($_GET['type']) && $_GET['type']=='event' && isset($_GET['id']))
{
  $sql="delete from events where id='$_GET[id]'";
  if(!mysql_query($sql))
  {
  echo mysql_error();
  }
  else
  {
   header("location:manage.php?type=events");
  }
}
else if(isset($_GET['type']) && $_GET['type']=='quote' && isset($_GET['id']))
{
  $sql="delete from quotes where id='$_GET[id]'";
  if(!mysql_query($sql))
  {
  echo mysql_error();
  }
  else
  {
   header("location:manage.php?type=quote");
  }
}
else if(isset($_GET['type']) && $_GET['type']=='speak' && isset($_GET['id']))
{
  $sql="delete from donor_speak where id='$_GET[id]'";
  if(!mysql_query($sql))
  {
  echo mysql_error();
  }
  else
  {
   header("location:manage.php?type=speak");
  }
}
else if(isset($_GET['type']) && $_GET['type']=='faq' && isset($_GET['id']))
{
  $sql="delete from faq where id='$_GET[id]'";
  if(!mysql_query($sql))
  {
  echo mysql_error();
  }
  else
  {
   header("location:manage.php?type=faq");
  }
}

?>